home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderInput
- {
- float4 Position : POSITION;
- float ParticleSize : PSIZE;
- float4 Color : COLOR0;
- };
-
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderOutput
- {
- float4 Position : POSITION;
- float ParticleSize : PSIZE;
- float4 Color : COLOR0;
- float2 ParticleUv : TEXCOORD0;
- };
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- CVertexShaderOutput PointParticleVSProcess (const CVertexShaderInput input);
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- CVertexShaderOutput PointParticleVSProcess (const CVertexShaderInput input)
- {
- CVertexShaderOutput output;
-
- output.Position = mul (input.Position,WorldCameraProjection);
-
- float3 camToPos = input.Position - ObjectLocalCameraPosition;
- float invCamToPosDistance = rsqrt(camToPos.x * camToPos.x + camToPos.y * camToPos.y + camToPos.z * camToPos.z);
-
- output.ParticleSize = input.ParticleSize * FovResScale * invCamToPosDistance;
-
- output.Color = input.Color;
- output.ParticleUv = (0.0f,0.0f);
-
- return output;
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------